package com.zc.redisson;

import org.redisson.api.RedissonClient;
import org.redisson.spring.data.connection.RedissonConnectionFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RedissonConfig {

//    @Value("${redisson.config}")
//    private String redissonConfig;
//
//
//    @Bean(destroyMethod = "shutdown")
//    public RedissonClient redisson() throws IOException {
//        Assert.notNull(redissonConfig, "redisson配置无效");
//        return Redisson.create(Config.fromYAML(redissonConfig));
//    }


    @Bean(name = "redissonConnectionFactory")
    public RedissonConnectionFactory redissonConnectionFactory(RedissonClient redissonClient) {
        return new RedissonConnectionFactory(redissonClient);
    }

}
